package com.example.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @program: demo
 * @author: JCM
 * @create: 2023-04-24 09:15
 * @description:
 **/
@RestController
@RequestMapping("/user")
public class UserController {

//    @RequestMapping("/get")
//    public String getMethod() {
//        System.out.println("执行了 get-method");
//        return "user-getMethod";
//    }
    @RequestMapping("/login")
    public String login() {
        System.out.println("执行了 login");
        return "login";
    }
    @RequestMapping("/reg")
    public String postMethod() {
        System.out.println("执行了 reg");
        return "reg";
    }
    @RequestMapping("/nullE")
    public String NE() {
        Object object = null;
        object.hashCode();
        System.out.println("执行了 nullE");
        return "空指针异常";
    }
}
